/**
 * @description 分享到其它平台 + 滚动到顶部
 */

import {
  QqOutlined,
  WeiboOutlined
} from '@ant-design/icons';
import { FloatButton } from 'antd';

const title = '这是分享链接标题'
function SharePlatform() {


  // 分享微博
  let shareToMicroblog = () => {
    //跳转地址
    window.open(
      "https://service.weibo.com/share/share.php?url=" +
      encodeURIComponent(location.href) +
      "&title=" + title
    )
  }

  // 分享qq
  let shareToQQRom = () => {
    //跳转地址
    window.open(
      "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" +
      encodeURIComponent(location.href) +
      "&title=" +
      title +
      "&summary=" +
      title
    );
  }

  return (
    < FloatButton.Group
      shape="square"
    >
      <FloatButton icon={<QqOutlined />} onClick={shareToQQRom} />
      <FloatButton icon={<WeiboOutlined />} onClick={shareToMicroblog} />
      < FloatButton.BackTop />
    </FloatButton.Group>




  )
}

export default SharePlatform